<?php
  session_start();
?>
<html>
<head>
<meta http-equiv="Content-Type" content="html/text; charset=utf-8" />
<title>管理员登陆</title>
</head>
<body>
<?php
include "mysql.php";
$aa=new mysql;
$aa->link("");
$tijiao=$_POST["tijiao"];
if($tijiao=="提交"){
        $user_name=$_POST["user_name"];
         
        $user_pw=$_POST["user_pw"];
        $query="select * from manager_info where user_name='$user_name'";
       
        $rst=$aa->excu($query);
        if(mysql_num_rows($rst)==0){
            echo "<script language=javascript>alert('用户名不存在，请重新输入');</script>";
        }else{
            $manage=mysql_fetch_array($rst);
            if($manage["user_pw"]!=$user_pw){
                echo "<script language=javascript>alert('密码错误，请重新输入');</script>";
            }else{
                $_SESSION["user_name"]=$user_name;
                echo "<script language=javascript>alert('登陆成功');location.href='indexss.php';</script>";
            }
        }

}

?>
    <br> <br> <br> <br> <br> <br> <br> <br> <br> <br>
    <table width="30%" border="0" align="center" cellspacing="0"  cellpadding="0" >
        <tr>
            <td height="20" align="center" ><b>欢迎您登陆</b> </td>
        </tr>
    </table>
 <form action="login.php" method="post">
<table width="30%" border="1" align="center" cellspacing="0"  cellpadding="0" >
<tr>
 <td height="15" align="right" width="30%">用户名 </td>
 <td height="15" align="left" width="70%"><input type="text" name="user_name"></td>
</tr>
<tr>
 <td height="15" align="right" width="30%">密码 </td>
 <td height="15" align="left" width="70%"><input type="password" name="user_pw"></td>
</tr>
<tr>
    <td height="15" align="center" colspan="2">
        <input type="submit" name="tijiao" value="提交">&nbsp;&nbsp;
        <input type="submit" name="tijiao" value="重置">
   </td>
</tr>
</table>
 </form>     
</body>
</html>













